package com.campus.web.controller;


import com.campus.app.service.NotificationsService;
import com.campus.commons.entity.Notification;
import com.campus.commons.utils.MyPage;
import com.campus.commons.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * <p>
 * 消息【一些通知消息】表 前端控制器
 * </p>
 *
 * @author Rin
 * @since 2021-01-25
 */
@RestController
@RequestMapping("/notification")
public class NotificationController {
@Autowired
private NotificationsService notificationsService;

    @GetMapping("/")
    public ModelAndView toIndex() {
        return new ModelAndView("learn/notification/index");
    }


    @PostMapping("/all")
    public Result getAllNotification(MyPage myPage) {
        return notificationsService.getAllNotifications(myPage);
    }

}

